<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet library="css" name="bootstrap.css" /> 
        <h:outputScript library="js" name="jquery.js" />
        <h:outputScript library="js" name="bootstrap.js" />
        <style type="text/css">
            body {
                padding-top: 60px;
                padding-bottom: 40px;
            }
            .sidebar-nav {
                padding: 9px 0;
            }
        </style>
        <title>Market Place</title>
    </h:head>

    <h:body>
        <h:form>
            <div class="navbar navbar-inverse navbar-fixed-top">
                <div class="navbar-inner">
                    <div class="container">
                        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </a>
                        <h:link class="brand" outcome="index.xhtml" value="Market Place"/>
                        <div class="nav-collapse collapse">
                            <ul class="nav">
                                <ui:insert name="left">
                                    <c:if test="${empty mbUsers.user.login}">
                                        <li><h:link outcome="frm_login.xhtml" value="Se connecter"/></li>
                                        <li><h:link outcome="frm_register_acheteur.xhtml" value="Inscription Acheteur"/></li>
                                        <li><h:link outcome="frm_register_vendeur.xhtml" value="Inscription Vendeur"/></li>
                                    </c:if>
                                    <c:if test="${ mbUsers.user.acheteur}">
                                        <li><h:link outcome="search_produit.xhtml" value="Rechercher un produit"/></li>
                                        <li><h:link outcome="search_magasin.xhtml" value="Rechercher un magasin"/></li>
                                        <li><h:link outcome="search_vendeur.xhtml" value="Rechercher un vendeur"/></li>
                                        <li><h:link outcome="panier.xhtml" value="Panier"/></li>
                                    </c:if>
                                    <c:if test="${ mbUsers.user.vendeur}"> 
                                        <li><h:link outcome="store_new.xhtml" value="Ajouter un magasin"/></li>
                                        <li><h:link outcome="store_index.xhtml" value="Mes magasins"/></li>
                                    </c:if> 
                                </ui:insert>
                            </ul>
                            <div class="nav-collapse collapse">
                                <ui:insert name="top">
                                    <c:if test="${not empty mbUsers.user.login}">
                                        <p class="navbar-text pull-right">
                                            Bonjour #{mbUsers.user.nom} | <b>#{mbUsers.user.typeUser}</b> |
                                            <h:commandLink action="#{mbUsers.logout()}" value="Logout"/>
                                        </p>
                                    </c:if>
                                </ui:insert>
                            </div>
                        </div><!--/.nav-collapse -->
                    </div>
                </div>
            </div>            
        </h:form>
        <div class="container">
            <!-- Main hero unit for a primary marketing message or call to action -->
            <div>
                <c:if test="${not empty mbUsers.user.login}">
                    <ui:insert name="content"></ui:insert>
                </c:if>
                <c:if test="${empty mbUsers.user.login}">
                    <ui:insert name="content">
                        <f:view>
                            <h:form>
                                <h1><h:outputText value="Login"/></h1>
                                <h:panelGrid columns="2">
                                    <h:outputLabel value="Login:" for="login" />
                                    <h:inputText id="login" value="#{mbUsers.user.login}" title="Login" />
                                    <h:outputLabel value="Pwd:" for="pwd" />
                                    <h:inputText id="pwd" value="#{mbUsers.user.pwd}" title="Pwd" />
                                    <h:form>
                                        <h:commandButton action="#{mbUsers.checkLogin()}" value="Log In" class="btn btn-large btn-primary" />
                                    </h:form>
                                </h:panelGrid>
                            </h:form>
                        </f:view>
                    </ui:insert>
                </c:if>     
            </div>

            <!-- Example row of columns 
            <div class="row">
                <div class="span4">
                <h2>Heading</h2>
                <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
                <p><a class="btn" href="#">View details &raquo;</a></p>
                </div>
                <div class="span4">
                <h2>Heading</h2>
                <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
                <p><a class="btn" href="#">View details &raquo;</a></p>
            </div>
                <div class="span4">
                <h2>Heading</h2>
                <p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
                <p><a class="btn" href="#">View details &raquo;</a></p>
                </div>
            </div>

            <hr />-->

            <footer>
                <p>&copy; Company 2012 - <ui:insert name="bottom">Gael Francillette et Rolland Cerf</ui:insert></p>
            </footer>

        </div>
        <!--<div id="bottom">
            <ui:insert name="bottom">Gael Francillette - Rolland Cerf</ui:insert>
        </div>-->
        
    </h:body>

</html>
